package com.Maykk.Demo07;

import java.io.*;
import java.net.Socket;

/**
 * @ClassName: Demo01
 * @Description: TODO TCP 客户端发送数据存储进文件 - 发送端
 * @Author: MaykkStar@163.com
 */
public class SendServer {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1", 9527);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
        String line;
        while (!"".equals(line = br.readLine())) {
            // if ("over".equals(line)) break;
            bw.write(line);
            bw.newLine();
            bw.flush();
        }
        socket.close();
    }
}
